﻿<%@ Page Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true" CodeFile="ontology.aspx.cs" Inherits="Ontology" EnableViewStateMac="false" %>
<%@ Import Namespace="PRDP.DS.Tree" %>
<asp:Content ID="OntologyList" ContentPlaceHolderID="content" Runat="Server">
<STYLE type=text/css>
BODY {
	MARGIN: 0px
}
.tdtitle {
	PADDING-BOTTOM: 1mm; PADDING-LEFT: 1mm; PADDING-TOP: 1mm
}
.text14-18 {
	PADDING-BOTTOM: 1mm; PADDING-LEFT: 1mm; WIDTH: 216px; PADDING-TOP: 1mm
}
.txtspan {
	FONT-SIZE: 15px
}
.maintab {
  margin:10px 0px 0px 8px
}
A.a01_lan:link {
	FONT-FAMILY: Arial; COLOR: #332bbc; FONT-SIZE: 12px; TEXT-DECORATION: underline
}
A.a01_lan:visited {
	FONT-FAMILY: Arial; COLOR: #332bbc; FONT-SIZE: 12px; TEXT-DECORATION: underline
}
A.a01_lan:hover {
	FONT-FAMILY: Arial; COLOR: red; FONT-SIZE: 12px; TEXT-DECORATION: underline
}
A.a01_lan:active {
	FONT-FAMILY: Arial; COLOR: #332bbc; FONT-SIZE: 12px; TEXT-DECORATION: underline
}
</STYLE>
<script type="text/javascript" language="javascript">
function showMore(categoryId)
{
    for(var start=5;;start++)
    {
        if(document.getElementById("tr_" + categoryId + "_" + start)!=null)
        {
            document.getElementById("tr_" + categoryId + "_" + start).style.display = "block";
        }
        else
        {
            break;
        }
    }
    document.getElementById("linkMore_" + categoryId).innerHTML = "收缩节点";
    document.getElementById("linkMore_" + categoryId).href = "javascript:hideMore('" + categoryId + "')";
}

function hideMore(categoryId)
{
    for(var start=5;;start++)
    {
        if(document.getElementById("tr_" + categoryId + "_" + start)!=null)
        {
            document.getElementById("tr_" + categoryId + "_" + start).style.display = "none";
        }
        else
        {
            break;
        }
    }
    document.getElementById("linkMore_" + categoryId).innerHTML = "展开节点";
    document.getElementById("linkMore_" + categoryId).href = "javascript:showMore('" + categoryId + "')";
}

function ontology(path)
{
    if(path == '')
        return;
    var orginalPath = document.getElementById('ctl00_content_hfTreePath').value;
    if(path == '..')
    {
        if(orginalPath == '0')
            return;
        path = orginalPath.substr(0,orginalPath.lastIndexOf('.'));
    }
    else
    {
        path = orginalPath + "." + path;
    }
    location.href = "?path=" + path;
}

function keywordSearchFromOntology()
{
    location.href = "search.aspx?searchType="+topTypeId+"&keyword="+$Obj("ctl00_q").value;
}
</script>
  <TABLE id=Table1 border=0 cellSpacing=0 cellPadding=0 class="maintab">
  <TBODY>
  <!--ontology-1开始-->
   <TR>
    <TD align=middle>
	<!--table2开始-->
      <TABLE id=Table2 border=0 cellSpacing=0 cellPadding=0 width="100%">
        <TBODY>
        <TR>
          <TD align=left>
		  <SPAN id=Label3>
            <TABLE width="100%">
              <TBODY>
              <TR>
                <TD class=tdtitle bgColor=#ebebeb><SPAN 
                  class=txtspan><%=currentNode.Name%>&nbsp;&nbsp;<a href="javascript:ontology('..')">..</a>&nbsp;&nbsp;<%if (currentNode.size() > ROW_COUNT * COLUMN_COUNT)
                                                                { %>(<a id="linkMore_<%=currentNode.Id%>" href="javascript:showMore('<%=currentNode.Id%>')">展开节点</a>)<%} %></SPAN></TD></TR></TBODY></TABLE>
            <TABLE>
              <TBODY>
                 <TR id="tr_<%=currentNode.Id%>_0">
                  <!--输出子条目开始-->
                  <%int count = 0; int rowCount = 0;%>
                    <%foreach (PRDP.DS.Tree.TreeNode treeNode in currentNode.Children)
                      { %>
                    <TD class=text14-18><A class=a03_lan href="javascript:ontology_search('<%=currentNode.Id%>.<%=treeNode.Id%>')"><%=treeNode.Name%></A>
                    &nbsp;<%if (treeNode.Child != null && treeNode.Child.size() > 0)
                            { %><a href="javascript:ontology('<%=treeNode.Id%>')">+</a><%} %></TD>
                    <%
                        if (++count % COLUMN_COUNT == 0)
                        {
                    %>
                    </TR><%if (++rowCount >= ROW_COUNT)
                           { %><TR id="tr_<%=currentNode.Id%>_<%=rowCount %>" style="display:none;"><%}
                           else
                           { %>
                           <TR id="tr_<%=currentNode.Id%>_<%=rowCount %>"><%} %>
                    <%
                        }
                      }
                    %>
                   <%for (int i = 0; i < (COLUMN_COUNT - count % COLUMN_COUNT); i++)
                     {
                        %>
                    <TD></TD>
                    <%} %>
                  <!--输出子条目结束-->
                 </TR>     
			</TBODY></TABLE></SPAN>
			</TD>
        </TR></TBODY></TABLE>
		<!--table2结束-->
	  </TD></TR>
  <!--ontology-1结束-->
 </TBODY></TABLE>
 <form name="ontologyForm" id="ontologyForm">
    <asp:HiddenField ID="hfTreePath" runat="server" />
 </form>
</asp:Content>

